package com.peter.demo.annotations.configures.component;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 *  注解@ComponentScan:
 *  1.value指明扫描的包
 *  2.includeFilters是指明只扫描哪些类 另，excludeFilters是指明哪些类不被扫描到相应地
 *  3.type是按哪种类型进行过滤
 *  4.value是一个数组，里面为具体的过滤条件实体
 *  5.useDefaultFilters 不使用spring的默认扫描
 */
@Configuration
@ComponentScan(value = "com.peter.project",
        includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION,value = {Controller.class, Service.class, Repository.class})},
        useDefaultFilters = false
)
public class MyConfig {
}
